package fr.ralmn.OgameDroid.Object;

/**
 * 
 * @author Ralmn
 * 
 */
public class Mine extends Batiment {

	public static enum MineType {
		Metal, Cristal, Deterium;
	}

	private MineType type;
	private double production;
	protected double baseEnergie;
	protected double baseCoast;

	/**
	 * 
	 * @param n
	 *            nom
	 * @param d
	 *            description
	 * @param bco
	 *            baseCoast
	 * @param bm
	 *            baseMetal
	 * @param bc
	 *            baseCristal
	 * @param bd
	 *            base Deterium
	 * @param be
	 *            Base Energie
	 * @param p
	 *            production
	 * @param t
	 *            type de la mine
	 */
	public Mine(String n, String d, double bco, double bm, double bc,
			double bd, double be, double p, MineType t, int i) {
		super(n, d, i);
		baseCoast = bco;
		baseMetal = bm;
		baseCristal = bc;
		baseDeterium = bd;
		baseEnergie = be;
		production = p;
		type = t;
		super.type = BatimentsType.Ressources;
	}

	public MineType getType() {
		return type;
	}

	/**
	 * 
	 * @param lvl
	 *            niveau
	 * @return production/lvl/heure
	 */
	public int getProduction(int lvl) {

		int p = (int) (production * lvl * Math.pow(1.1, lvl));
		return p;

	}

	public int getMetalCoast(int lvl) {
		int c = (int) (baseMetal * Math.pow(baseCoast, lvl - 1));
		return c;
	}

	public int getCristalCoast(int lvl) {

		int c = (int) (baseCristal * Math.pow(baseCoast, lvl - 1));
		return c;
	}

	public int getEnergieCoast(int lvl) {
		int e = (int) (baseEnergie * lvl * Math.pow(1.1, lvl));
		return e;
	}

}
